//导入 createSlice
import {createSlice} from '@reduxjs/toolkit'

//创建 slice 对象
let slice = createSlice({
  name: 'zan',
  initialState: {value: 0},
  reducers: {
    add: (state, action) => {
      state.value += 1;
    }
  }
});

//暴露
export default slice.reducer;

//获取 action creator
export let {add} = slice.actions;
